import { defineStore } from "pinia";

export interface UserState {
  userInfo: User;
}

export type User = {
  name?: string;
  gender?: string;
  age?: number;
  phone?: string;
};

export const useUserStore = defineStore({
  id: "app-user",
  state: (): UserState => ({
    userInfo: {} as User,
  }),
  actions: {
    setUserInfo(user: User) {
      this.userInfo = user;
    },
  },
});
